Recognition apparatus based on deep neural network, training apparatus and methods thereof

ABSTRACT

A recognition apparatus based on a deep neural network, a training apparatus and methods thereof. The deep neural network is obtained by inputting training samples comprising positive samples and negative samples into an input layer of the deep neural network and training. The apparatus includes: a judging unit configured to judge that a sample to be recognized is a suspected abnormal sample when confidences of positive sample classes in a classification result outputted by an output layer of the deep neural network are all less than a predefined threshold value. Hence, reliability of a confidence of a classification result outputted by the deep neural network may be efficiently improved.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of Chinese Application No.201610298158.0, filed May 6, 2016, in the Chinese Intellectual PropertyOffice, the disclosure of which is incorporated herein by reference.

BACKGROUND 1. Field

This disclosure relates to the field of information technology, and inparticular to a recognition apparatus based on a deep neural network, atraining apparatus and methods thereof.

2. Description of the Related Art

Nowadays, as continuous development of information technologies,recognition methods based on a deep neural network (DNN) have succeededin the field of classification. An existing DNN is a hierarchical model.FIG. 1 is a schematic diagram of an existing DNN. As shown in FIG. 1,the existing DNN consists of an input layer 101, several hidden layers102 and an output layer 103. The input layer 101 generally be inputto-be-processed data; the hidden layers 102 may include a convolutionallayer, a pooling layer, or an fully connected layer, etc.; and for anissue of classification, the output layer 103 may be a classifier, suchas a softmax classifier, or a support vector machine (SVM), etc.

The existing DNN usually takes minimization of network loss (alsoreferred to a classification error) as an optimization target intraining, with an optimization method being a backward propagationalgorithm. FIG. 2 is a schematic diagram of training a DNN by using anexisting method. As shown in FIG. 2, first, training samples areinputted into the input layer 101, with information being forwardpropagated along the DNN, then it is propagated to the output layer 103via the hidden layers 102, and a classification result outputted by theoutput layer 103 is compared with a real value of a class of thetraining sample to obtain the network loss; thereafter, the network lossis transmitted back layer by layer, thereby correcting parameters ofeach of the output layer 103, the hidden layers 102 and the input layer101. The above steps are repeated, until the network loss satisfies aspecific convergence condition, and it is deemed that the optimizationtarget of the DNN is achieved, and the training is ended.

FIG. 3 is a schematic diagram of performing recognition by using a DNNtrained by using an existing training method. As show in FIG. 3, when aninputted to-be-recognized sample is an abnormal sample (such as anegative sample), confidences of outputted positive sample classes are3%, 7%, and 90%, respectively.

It should be noted that the above description of the background ismerely provided for clear and complete explanation of this disclosureand for easy understanding by those skilled in the art. And it shouldnot be understood that the above technical solution is known to thoseskilled in the art as it is described in the background of thisdisclosure.

SUMMARY

Additional aspects and/or advantages will be set forth in part in thedescription which follows and, in part, will be apparent from thedescription, or may be learned by practice of the embodiments.

When a DNN trained by using an existing training method is used torecognize, in a case where an input to-be-recognized sample is anabnormal sample, a confidence (such as 90% in FIG. 3) of a positivesample class in an output classification result is still very high,thereby resulting in the classification result being unreliable.

Embodiments of this disclosure provide a recognition apparatus based ona deep neural network, a training apparatus and methods thereof, inwhich by inputting training samples including positive samples andnegative samples into an input layer of the deep neural network andtraining and judging that a sample to be recognized is a suspectedabnormal sample when confidences of outputted positive sample classesare all less than a predefined threshold value, reliability of aconfidence of a classification result outputted by the deep neuralnetwork may be efficiently improved.

According to a first aspect of the embodiments of this disclosure, thereis provided a recognition apparatus based on a deep neural network, thedeep neural network being obtained by inputting training samplesincluding positive samples and negative samples into an input layer ofthe deep neural network and training, the apparatus including: a judgingunit configured to judge that a sample to be recognized is a suspectedabnormal sample when confidences of positive sample classes in aclassification result outputted by an output layer of the deep neuralnetwork are all less than a predefined threshold value.

According to a second aspect of the embodiments of this disclosure,there is provided a training apparatus for a deep neural network,including: an inputting unit configured to input training samplesincluding positive samples and negative samples into an input layer ofthe deep neural network; a setting unit configured to, for the positivesamples in the training samples, set real-value tags of positive sampleclasses of the positive samples to be 1, and set real-value tags ofother positive sample classes to be 0; and for the negative samples inthe training samples, set real-value tags of all positive sample classesto be 0; and an outputting unit configured to make an output layer ofthe deep neural network output similarities between the training samplesand the positive sample classes.

According to a third aspect of the embodiments of this disclosure, thereis provided an electronic device, including the recognition apparatus asdescribed in the first aspect or the training apparatus as described inthe second aspect.

An advantage of the embodiments of this disclosure exists in that byinputting training samples including positive samples and negativesamples into an input layer of the deep neural network and training andjudging that a sample to be recognized is a suspected abnormal samplewhen confidences of outputted positive sample classes are all less thana predefined threshold value, reliability of a confidence of aclassification result outputted by the deep neural network may beefficiently improved.

With reference to the following description and drawings, the particularembodiments of this disclosure are disclosed in detail, and theprinciples of this disclosure and the manners of use are indicated. Itshould be understood that the scope of the embodiments of thisdisclosure is not limited thereto. The embodiments of this disclosurecontain many alternations, modifications and equivalents within thescope of the terms of the appended claims.

Features that are described and/or illustrated with respect to oneembodiment may be used in the same way or in a similar way in one ormore other embodiments and/or in combination with or instead of thefeatures of the other embodiments.

It should be emphasized that the term“includes/including/comprises/comprising” when used in thisspecification is taken to specify the presence of stated features,integers, steps or components but does not preclude the presence oraddition of one or more other features, integers, steps, components orgroups thereof.

BRIEF DESCRIPTION OF THE DRAWINGS

The drawings are included to provide further understanding of thisdisclosure, which constitute a part of the specification and illustratethe preferred embodiments of this disclosure, and are used for settingforth the principles of this disclosure together with the description.It is obvious that the accompanying drawings in the followingdescription are some embodiments of this disclosure, and for those ofordinary skills in the art, other accompanying drawings may be obtainedaccording to these accompanying drawings without making an inventiveeffort. In the drawings:

FIG. 1 is a schematic diagram of an existing DNN;

FIG. 2 is a schematic diagram of training a DNN by using an existingmethod;

FIG. 3 is a schematic diagram of performing recognition by using a DNNtrained by using an existing training method;

FIG. 4 is a schematic diagram of the recognition apparatus based on adeep neural network of Embodiment 1 of this disclosure;

FIG. 5 is a schematic diagram of performing recognition by using thedeep neural network of Embodiment 1 of this disclosure;

FIG. 6 is another schematic diagram of performing recognition by usingthe deep neural network of Embodiment 1 of this disclosure;

FIG. 7 is a schematic diagram of the training apparatus for a deepneural network of Embodiment 1 of this disclosure;

FIG. 8 is a schematic diagram of training the deep neural network ofEmbodiment 1 of this disclosure;

FIG. 9 is another schematic diagram of training the deep neural networkof Embodiment 1 of this disclosure;

FIG. 10 is a schematic diagram of setting negative sample classes andconfidences of the negative sample classes to be invalid of Embodiment 1of this disclosure;

FIG. 11 is a schematic diagram of the electronic device of Embodiment 2of this disclosure;

FIG. 12 is a block diagram of a systematic structure of the electronicdevice of Embodiment 2 of this disclosure;

FIG. 13 is a flowchart of the recognition method based on a deep neuralnetwork of Embodiment 3 of this disclosure; and

FIG. 14 is a flowchart of the training method for a deep neural networkof Embodiment 3 of this disclosure.

DETAILED DESCRIPTION

These and further aspects and features of the present disclosure will beapparent with reference to the following description and attacheddrawings. In the description and drawings, particular embodiments of thedisclosure have been disclosed in detail as being indicative of some ofthe ways in which the principles of the disclosure may be employed, butit is understood that the disclosure is not limited correspondingly inscope. Rather, the disclosure includes all changes, modifications andequivalents coming within the terms of the appended claims.

Embodiment 1

FIG. 4 is a schematic diagram of the recognition apparatus based on adeep neural network of Embodiment 1 of this disclosure. As shown in FIG.4, the apparatus 400 includes:

-   -   a judging unit or judger 401 configured to judge that a sample        to be recognized is a suspected abnormal sample when confidences        of positive sample classes in a classification result outputted        by an output layer of the deep neural network are all less than        a predefined threshold value.

In this embodiment, the deep neural network (DNN) is obtained byinputting training samples including positive samples and negativesamples into an input layer of the deep neural network and training.

In this embodiment, the apparatus 400 may include the DNN, and may notinclude the DNN, but performs judgment by using the outputtedclassification result of the DNN.

It can be seen from the above embodiment that by inputting trainingsamples including positive samples and negative samples into an inputlayer of the deep neural network and training and judging that a sampleto be recognized is a suspected abnormal sample when confidences ofoutputted positive sample classes are all less than a predefinedthreshold value, reliability of a confidence of a classification resultoutputted by the deep neural network may be efficiently improved.

In this embodiment, the DNN may be any type of existing DNNs. Forexample, the DNN is an existing convolutional neural network (CNN). Andthe DNN may include an input layer, several hidden layers and an outputlayer.

In this embodiment, the classification result outputted by the outputlayer of the deep neural network includes only the positive sampleclasses and corresponding confidences of the positive sample classes,but does not include negative sample classes and confidences thereof.

In this embodiment, the abnormal sample refers to a sample not includedin the positive sample classes outputted by the output layer of the DNN,that is, the sample is a negative sample. And the sample to berecognized being a suspected abnormal sample means that the sample to berecognized may possibly be an abnormal sample.

In this embodiment, the confidences of the positive sample classes maybe expressed by similarities between the sample to be recognized and thepositive sample classes, and may also be expressed by a probability thatthe sample to be recognized belongs to the positive sample classes, anda method of expression of the confidences is not limited in thisembodiment.

In this embodiment, when the inputted sample to be recognized is anabnormal sample, a sum of the confidences of the positive sample classesoutputted by the output layer of the DNN may not be 1.

FIG. 5 is a schematic diagram of performing recognition by using thedeep neural network of Embodiment 1 of this disclosure. As shown in FIG.5, the inputted sample to be recognized is a pentagram sample, that is,the sample to be recognized is an abnormal sample. The confidences ofthe positive sample classes outputted by the DNN are expressed bysimilarities between the sample to be recognized and the positive sampleclasses, and the classification result outputted by the DNN includes 0.1for a square, 0.15 for a round, and 0.25 for a triangle, respectively.

FIG. 6 is another schematic diagram of performing recognition by usingthe deep neural network of Embodiment 1 of this disclosure. As shown inFIG. 6, the input sample to be recognized is a pentagram sample, thatis, the sample to be recognized is an abnormal sample. The confidencesof the positive sample classes outputted by the DNN are expressed by aprobability that the sample to be recognized belongs to the positivesample classes, and the classification results outputted by the DNN are5% for a square, 10% for a round, and 20% for a triangle, respectively.

In this embodiment, the predefined threshold value may be set asactually demanded, for example, the predefined threshold value may be0.3. Hence, as the confidences of the positive sample classes outputtedby the DNN shown in FIG. 5 and FIG. 6 are all less than 0.3, the judgingunit 401 judges that the sample to be recognized is an abnormal sample.

In this embodiment, the DNN is obtained by inputting the trainingsamples including positive samples and negative samples into the inputlayer of the DNN and training. A training apparatus and method for adeep neural network of the embodiment of this disclosure shall beillustrated respectively below in cases where the confidences of thepositive sample classes are expressed by similarities between the sampleto be recognized and the positive sample classes and the probabilitythat the sample to be recognized belongs to the positive sample classesin the process of recognition.

FIG. 7 is a schematic diagram of the training apparatus for a deepneural network of Embodiment 1 of this disclosure. As shown in FIG. 7,the apparatus 700 includes:

-   -   an inputting unit 701 configured to input training samples        including positive samples and negative samples into an input        layer of the deep neural network;    -   a setting unit or settor 702 configured to, for the positive        samples in the training samples, set real-value tags of positive        sample classes of the positive samples to be 1, and set        real-value tags of other positive sample classes to be 0; and        for the negative samples in the training samples, set real-value        tags of all positive sample classes to be 0; and    -   an outputting unit 703 configured to make an output layer of the        deep neural network output similarities between the training        samples and the positive sample classes.

In this embodiment, after the training samples are inputted into theDNN, the setting unit 702 sets the real-value tags of the positivesample classes of the DNN.

FIG. 8 is a schematic diagram of training the deep neural network ofEmbodiment 1 of this disclosure. As shown in FIG. 8, for the square ofthe positive samples in the training samples, the real-value tag of thepositive sample class of the positive sample is set to be 1, and thereal-value tags of other positive sample classes are set to be 0; andfor the pentagram of the negative samples in the training samples, thereal-value tags of all positive sample classes are set to be 0.

Hence, for the negative samples in the training samples, the real-valuetags of all positive sample classes are set to be 0, and only thesimilarities between the training samples and the positive sampleclasses are outputted. Reliability of the similarities outputted in therecognition may be improved.

In this embodiment, the outputting unit 703 may make the output layer ofthe deep neural network output similarities between the training samplesand the positive sample classes by using an existing method. Forexample, a sigmoid layer is taken as the output layer, and during thetraining, initial values of the similarities between the trainingsamples and the positive sample classes outputted by the DNN may be setby using an existing method, such as setting the initial values of thesimilarities randomly.

In this embodiment, the similarities between the training samples andthe positive sample classes may be expressed by, for example, Euclideandistances; however, an expression method of the similarities is notlimited in this embodiment.

In this embodiment, the similarities are positive numbers less than 1,and need not be normalized. That is, a sum of the similarities betweenthe training samples and the positive sample classes outputted by theoutput layer of the DNN may not be 1.

In this embodiment, as shown in FIG. 7, the apparatus 700 may furtherinclude:

-   -   an acquiring unit or acquirer 704 configured to obtain a network        loss according to the similarities between the training samples        and the positive sample classes outputted by the output layer of        the deep neural network and real values of the training samples        obtained according to the real-value tags;    -   an adjusting unit or adjustor 705 configured to, for the        positive samples in the training samples, adjust the network        loss according to a predefined weight; and    -   a backward propagating unit or propagator 706 configured to        perform backward propagation of the deep neural network        according to the adjusted network loss.

In this embodiment, the real values of the training samples are obtainedaccording to the real-value tags set by the setting unit 702. And amethod for obtaining the network loss (also referred to a classificationerror) by the acquiring unit 704 may be an existing method. For example,a difference between the similarities between the training samples andthe positive sample classes outputted by the DNN and the real values ofthe training samples may be taken as the network loss.

In this embodiment, the adjusting unit 705 may adjust the network lossaccording to Formula (1) below:

$\begin{matrix}{l^{\prime} = \left\{ {\begin{matrix}{l,{{{if}\mspace{14mu} s} \in \left\{ {negative} \right\}}} \\{{l \times w},{{{if}\mspace{14mu} s} \in \left\{ {positive} \right\}}}\end{matrix};} \right.} & (1)\end{matrix}$

where, l′ denotes the adjusted network loss, l denotes the network lossbefore being adjusted, w denotes the predefined weight, s ∈ {negative}denotes that a current training sample is a negative sample, and s ∈{positive} denotes that a current training sample is a positive sample.

In this embodiment, the predefined weight may be set according to anactual situation. For example, when the negative sample is relativelysimple, the predefined weight may be set to be a positive number lessthan 1; and when the negative sample is relatively complex, thepredefined weight may be set to be a positive number greater than 1.

Thus, by adjusting the network loss by setting the weight of thepositive samples, reliability of the classification result outputted bythe DNN may further be improved.

In this embodiment, the backward propagating unit 706 may employ anexisting method to perform backward propagation of the deep neuralnetwork according to the adjusted network loss.

For example, parameters of each of the output layer, the hidden layersand the input layer of the DNN are corrected, and the above step ofadjustment is repeated, until the network loss satisfies a certainconvergence condition.

The training apparatus and method for a deep neural network of theembodiment of this disclosure are described above in the case where theconfidences of the positive sample classes are expressed by similaritiesbetween the sample to be recognized and the positive sample classes inthe process of recognition. And the training method for a deep neuralnetwork of the embodiment of this disclosure shall be described below inthe case where the confidences of the positive sample classes areexpressed by the probability that the sample to be recognized belongs tothe positive sample classes in the process of recognition.

FIG. 9 is another schematic diagram of training the deep neural networkof Embodiment 1 of this disclosure. The output layer of the DNN is, forexample, a softmax layer. As shown in FIG. 9, the output classificationresult includes the positive sample classes and probabilities that thetraining samples belong to the positive samples, as well as the negativesample classes and probabilities that the training samples belong to thenegative sample classes.

In this embodiment, in training the DNN in the case where theconfidences of the positive sample classes are expressed by theprobability that the sample to be recognized belongs to the positivesample classes in the process of recognition, the adjusting unit 705 mayalso be used to adjust the network loss, an adjustment method being thesame as that described above, and being not going to be described hereinany further.

In this embodiment, when the output result of the DNN during trainingincludes the negative sample classes and their confidences, as shown inFIG. 4, the apparatus 400 may further include:

-   -   an invalidating unit or invalidator 402 configured to set the        negative sample classes and confidences of the negative sample        classes to be invalid when the output layer of the deep neural        network outputs the classification result.

In this embodiment, the invalidating unit 402 is optional, which isshown by a dotted box in FIG. 4.

FIG. 10 is a schematic diagram of setting the negative sample classesand the confidences of the negative sample classes to be invalid ofEmbodiment 1 of this disclosure. As shown in FIG. 10, the positivesample classes and their probabilities outputted during the recognitionare 5% for a square, 10% for a round, and 20% for a triangle,respectively, and a probability of the negative sample classes is 65%.The negative sample classes and their probability are set to be invalid,that is, the negative sample classes and their probability are notoutputted. Hence, a sum of the probabilities of the classificationresults outputted during the recognition is less than 100%.

Hence, as the positive sample classes and their probabilities areoutputted only, the reliability of the confidences of the outputtedclassification result may further be improved.

It can be seen from the above embodiment that by inputting trainingsamples including positive samples and negative samples into an inputlayer of the deep neural network and training and judging that a sampleto be recognized is a suspected abnormal sample when confidences ofoutputted positive sample classes are all less than a predefinedthreshold value, reliability of a confidence of a classification resultoutputted by the deep neural network may be efficiently improved.

Embodiment 2

An embodiment of this disclosure further provides an electronic device.FIG. 11 is a schematic diagram of the electronic device of Embodiment 2of this disclosure. As shown in FIG. 11, the electronic device 1100includes a recognition apparatus 1101 based on a deep neural network ora training apparatus 1102 for a deep neural network. In this embodiment,structures and functions of the recognition apparatus 1101 and thetraining apparatus 1102 are the same as those contained in Embodiment 1,and shall not be described herein any further.

FIG. 12 is a block diagram of a systematic structure of the electronicdevice of Embodiment 2 of this disclosure. As shown in FIG. 12, theelectronic device 1200 may be a computer and include a centralprocessing unit 1201 and a memory 1202, the memory 1202 being coupled tothe central processing unit 1201. This figure is illustrative only, andother types of structures may also be used, to supplement or replacethis structure and achieve a telecommunications function or otherfunctions.

As shown in FIG. 12, the electronic device 1200 may further include aninput unit 1203, a display 1204, and a power supply 1205.

In an implementation, the functions of the recognition apparatus basedon a deep neural network described in Embodiment 1 may be integratedinto the central processing unit 1201. In this embodiment, the centralprocessing unit 1201 may be configured to: judge that a sample to berecognized is a suspected abnormal sample when confidences of positivesample classes in a classification result outputted by an output layerof the deep neural network are all less than a predefined thresholdvalue.

In this embodiment, the confidences of positive sample classes refer tosimilarities between the sample to be recognized and the positive sampleclasses.

In this embodiment, the central processing unit 1201 may further beconfigured to: set negative sample classes and confidences of thenegative sample classes to be invalid when the output layer of the deepneural network outputs the classification result.

In another implementation, the functions of the training apparatus for adeep neural network described in Embodiment 1 may be integrated into thecentral processing unit 1201.

In this embodiment, the central processing unit 1201 may be configuredto: input training samples including positive samples and negativesamples into an input layer of the deep neural network; for the positivesamples in the training samples, set real-value tags of positive sampleclasses of the positive samples to be 1, and set real-value tags ofother positive sample classes to be 0; and for the negative samples inthe training samples, set real-value tags of all positive sample classesto be 0; and make an output layer of the deep neural network outputsimilarities between the training samples and the positive sampleclasses.

In this embodiment, the central processing unit 1201 may further beconfigured to: obtain a network loss according to the similaritiesbetween the training samples and the positive sample classes outputtedby the output layer of the deep neural network and real values of thetraining samples obtained according to the real-value tags; for thepositive samples in the training samples, adjust the network lossaccording to a predefined weight; and perform backward propagation ofthe deep neural network according to the adjusted network loss.

In this embodiment, the electronic device 1200 does not necessarilyinclude all the parts shown in FIG. 12.

As shown in FIG. 12, the central processing unit 1201 is sometimesreferred to as a controller or control, and may include a microprocessoror other processor devices and/or logic devices. The central processingunit 1201 receives input and controls operations of every components ofthe electronic device 1200.

In this embodiment, the memory 1202 may be, for example, one or more ofa buffer memory, a flash memory, a hard drive, a mobile medium, avolatile memory, a nonvolatile memory, or other suitable devices, whichmay store the above planned network information and deployed networkinformation, and may further store a program executing relatedinformation. And the central processing unit 1201 may execute theprogram stored in the memory 1202, to realize information storage orprocessing, etc. Functions of other parts are similar to those of therelevant art, which shall not be described herein any further. The partsof the electronic device 1200 may be realized by specific hardware,firmware, software, or any combination thereof, without departing fromthe scope of the present disclosure.

It can be seen from the above embodiment that by inputting trainingsamples including positive samples and negative samples into an inputlayer of the deep neural network and training and judging that a sampleto be recognized is a suspected abnormal sample when confidences ofoutputted positive sample classes are all less than a predefinedthreshold value, reliability of a confidence of a classification resultoutputted by the deep neural network may be efficiently improved.

Embodiment 3

An embodiment of this disclosure further provides a recognition methodbased on a deep neural network, which corresponds to the recognitionapparatus based on a deep neural network described in Embodiment 1. FIG.13 is a flowchart of the recognition method based on a deep neuralnetwork of Embodiment 3 of this disclosure. As shown in FIG. 13, themethod includes:

Step 1301: it is judged that a sample to be recognized is a suspectedabnormal sample when confidences of positive sample classes in aclassification result outputted by an output layer of the deep neuralnetwork are all less than a predefined threshold value.

FIG. 14 is a flowchart of the training method for a deep neural networkof Embodiment 3 of this disclosure. As shown in FIG. 14, the methodincludes:

Step 1401: training samples comprising positive samples and negativesamples are inputted into an input layer of the deep neural network;

Step 1402: for the positive samples in the training samples, real-valuetags of positive sample classes of the positive samples are set to be 1,and real-value tags of other positive sample classes are set to be 0;and for the negative samples in the training samples, real-value tags ofall positive sample classes are set to be 0; and

Step 1403: an output layer of the deep neural network is made outputsimilarities between the training samples and the positive sampleclasses.

In this embodiment, a method for judging the sample to be recognized, amethod for setting the real-value tags and a method for outputting thesimilarities are the same as those contained in Embodiment 1, and shallnot be described herein any further.

It can be seen from the above embodiment that by inputting trainingsamples including positive samples and negative samples into an inputlayer of the deep neural network and training and judging that a sampleto be recognized is a suspected abnormal sample when confidences ofoutputted positive sample classes are all less than a predefinedthreshold value, reliability of a confidence of a classification resultoutputted by the deep neural network may be efficiently improved.

An embodiment of the present disclosure provides a computer readableprogram code, which, when executed in a recognition apparatus based on adeep neural network, a training apparatus for a deep neural network, oran electronic device, will cause a computer unit to carry out therecognition method or the training method described in Embodiment 3 inthe recognition apparatus based on a deep neural network, the trainingapparatus for a deep neural network, or the electronic device.

An embodiment of the present disclosure provides a computer readablemedium, including a computer readable program code, which will cause acomputer unit to carry out the recognition method or the training methoddescribed in Embodiment 3 in a recognition apparatus based on a deepneural network, a training apparatus for a deep neural network, or anelectronic device.

The recognition method or the training method described with referenceto the embodiments of this disclosure carried out in the recognitionapparatus based on a deep neural network, the training apparatus for adeep neural network, or the electronic device, may be directly embodiedas hardware, software modules executed by a processor, or a combinationthereof. For example, one or more functional block diagrams and/or oneor more combinations of the functional block diagrams shown in FIG. 4and FIG. 7 may either correspond to software modules of procedures of acomputer program, or correspond to hardware modules. Such softwaremodules may respectively correspond to the steps shown in FIG. 13 andFIG. 14. And the hardware module, for example, may be carried out byfirming the soft modules by using a field programmable gate array(FPGA).

The soft modules may be located in an RAM, a flash memory, an ROM, anEPROM, and EEPROM, a register, a hard disc, a floppy disc, a CD-ROM, orany memory medium in other forms known in the art, such as anon-transitory computer readable storage. A memory medium may be coupledto a processor, so that the processor may be able to read informationfrom the memory medium, and write information into the memory medium; orthe memory medium may be a component of the processor. The processor andthe memory medium may be located in an ASIC. The soft modules may bestored in a memory of a mobile terminal, and may also be stored in amemory card of a pluggable mobile terminal. For example, if equipment(such as a mobile terminal) employs an MEGA-SIM card of a relativelylarge capacity or a flash memory device of a large capacity, the softmodules may be stored in the MEGA-SIM card or the flash memory device ofa large capacity.

One or more functional blocks and/or one or more combinations of thefunctional blocks in FIG. 4 and FIG. 7 may be realized as a universalprocessor, a digital signal processor (DSP), an application-specificintegrated circuit (ASIC), a field programmable gate array (FPGA) orother programmable logic devices, discrete gate or transistor logicdevices, discrete hardware component or any appropriate combinationsthereof carrying out the functions described in this application. Andthe one or more functional block diagrams and/or one or morecombinations of the functional block diagrams shown in FIG. 4 and FIG. 7may also be realized as a combination of computing equipment, such as acombination of a DSP and a microprocessor, multiple processors, one ormore microprocessors in communication combination with a DSP, or anyother such configuration.

This disclosure is described above with reference to particularembodiments. However, it should be understood by those skilled in theart that such a description is illustrative only, and not intended tolimit the protection scope of the present disclosure. Various variantsand modifications may be made by those skilled in the art according tothe spirits and principle of the present disclosure, and such variantsand modifications fall within the scope of the present disclosure.

What is claimed is:
 1. A recognition apparatus based on a deep neuralnetwork, the deep neural network being obtained by inputting trainingsamples comprising positive samples and negative samples into an inputlayer of the deep neural network and training, the apparatus comprising:a judger configured to judge that a sample to be recognized is asuspected abnormal sample when confidences of positive sample classes ina classification result outputted by an output layer of the deep neuralnetwork are all less than a predefined threshold value.
 2. The apparatusaccording to claim 1, wherein the confidences of positive sample classesrefer to similarities between the sample to be recognized and thepositive sample classes.
 3. The apparatus according to claim 1, whereinthe apparatus further comprises: an invalidator configured to setnegative sample classes and confidences of the negative sample classesto be invalid when the output layer of the deep neural network outputsthe classification result.
 4. A training apparatus for a deep neuralnetwork, comprising: an inputting unit configured to input trainingsamples comprising positive samples and negative samples into an inputlayer of the deep neural network; a settor configured to, for thepositive samples in the training samples, set real-value tags of firstpositive sample classes of the positive samples to be 1, and setreal-value tags of second positive sample classes to be 0; and for thenegative samples in the training samples, set real-value tags of allpositive sample classes to be 0; and an outputting unit configured tomake an output layer of the deep neural network output similaritiesbetween the training samples and the positive sample classes.
 5. Theapparatus according to claim 4, wherein the apparatus further comprises:an acquiror configured to obtain a network loss according to thesimilarities between the training samples and the positive sampleclasses outputted by the output layer of the deep neural network andreal values of the training samples obtained according to the real-valuetags; an adjustor configured to, for the positive samples in thetraining samples, adjust the network loss according to a predefinedweight; and a backward propagator unit configured to perform backwardpropagation of the deep neural network according to the adjusted networkloss.
 6. The apparatus according to claim 5, wherein the adjustoradjusts the network loss according to Formula (1): $\begin{matrix}{l^{\prime} = \left\{ {\begin{matrix}{l,{{{if}\mspace{14mu} s} \in \left\{ {negative} \right\}}} \\{{l \times w},{{{if}\mspace{14mu} s} \in \left\{ {positive} \right\}}}\end{matrix};} \right.} & (1)\end{matrix}$ where, l′ denotes adjusted network loss, l denotes networkloss before being adjusted, w denotes predefined weight, s ∈ {negative}denotes that a current training sample is a negative sample, and s ∈{positive} denotes that a current training sample is a positive sample.7. An electronic device, comprising the recognition apparatus as claimedin claim 1 or the training apparatus as claimed in claim 4.